package com.zhongwang.mms.module.half.dao;

import com.zhongwang.mms.gen.entity.HOrderDetail;
import com.zhongwang.mms.module.half.model.HOrderDetailExport;
import com.zhongwang.mms.module.half.model.HOrderDetailModel;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HOrderDetailDao {

    //添加出入库子单信息
    int insert(HOrderDetailModel record);

    /**出入库信息查询页面*/
    List<HOrderDetailModel> findAllByQuery(HOrderDetailModel hOrderDetailModel);

    //根据主单ID查询信息
    List<HOrderDetailModel> findAllByOdrId(Integer id);

    /**查询单据红冲页面数据*/
    List<HOrderDetailModel> selectAllByQuery(HOrderDetailModel query);

    /**单条红冲
     * @param hOrderDetail*/
    int updateDetailToRedByOdaId(HOrderDetail hOrderDetail);

    /**查询同一调拨单子单个数*/
    int selectCountByOdrRepId(String odrRepId);

    //根据子单ID查询主单和子单信息
    HOrderDetailModel selectAllByOdaId(Integer odaId);

    /**根据主单ID查询子单和主单信息*/
    List<HOrderDetailModel> selectDetailByOdrId(Integer odrId);

    /**导出查询*/
    List<HOrderDetailExport> findAllExportByQuery(HOrderDetailModel param);
    int createAllExportByQueryTempTable(HOrderDetailModel param);
    int createAllExportByQueryTempTableNotMoney(HOrderDetailModel param);

    /**查询出入库总金额和总重量*/
    HOrderDetailModel selectWeightAmount(HOrderDetailModel hOrderDetailModel);

    /**
     * @title: getHOrderDetailByPrimaryKey
     * @description: 根据主键获取实体
     * @param: [odaId]
     * @return: com.zhongwang.mms.gen.entity.HOrderDetail
     * @author: 徐一贺
     * @date: 2020/11/3 19:49
     * @versron: ver 1.0
     */
    HOrderDetail getHOrderDetailByPrimaryKey(Integer odaId);
}